<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>SMART VE</title>
<link rel="stylesheet" href="resources/css/jquery.mobile-1.3.0.css" />
<link rel="stylesheet" href="resources/css/main.css" />
<script type="text/javascript" src="resources/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="resources/js/jquery.mobile-1.3.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#PW').live('keypress', function(e) {
	    if (e.which == 13) {/* 13 == enter key@ascii */
	       login();
	    }
	});
});

	function joinForm(){
		location.href="member.do?action=memberAddForm";
	}
	function login(){
		var url="member.do";
		var action="login";
		
		var id=$("#VE_MEMBER_ID").val();
		var pw=$("#PW").val();
	
		if(id==""){
			alert('id(E-mail)을 입력해주세요.');
			return;
		}
		if(pw==""){
			alert('암호를 입력해 주세요.');
			return;
		}
		$.getJSON(url, "action="+action+"&VE_MEMBER_ID="+id+"&PW="+pw, function(json) {
			if(json>0){
				alert('로그인 되었습니다.');
				location.href = "project.do?action=projectList";
				
			}else{
				alert('아이디와 비밀번호를 확인해 주세요');
			}
		});
		
	}
</script>
</head>

<body>
<div id="wrapper" class="login" data-role="page">
	<div id="login" class="content">
		<h1><img src="resources/images/login_logo.png" alt="SMART VE" /></h1>
		<ul class="field">
			<li class="email"><input type="email" id="VE_MEMBER_ID" name="VE_MEMBER_ID" placeholder="E-mail" data-role="none" class="textform" /></li>
			<li class="pw"><input type="password" id="PW" name="PW" placeholder="Password" data-role="none" class="textform" /></li>
		</ul>
		<div class="button clfix">
<!-- 2013-05-14 비밀번호찾기, 로그인 버튼 수정 -->
			<a href="forget_pw.html" class="btn_forget_pw">Forget Password</a>
			<a href="javascript:login();" class="btn_login">Login</a>
		</div>
		<p class="account_tip"><a href="javascript:joinForm();"><img src="resources/images/login_tip.png" alt="New Account 프로젝트 생성 및 참여를 위해서는 E-mail만 입력하는 간단한 회원가입 절차가 필요합니다." /></a></p>
	</div>
</div>
</body>
<script type="text/javascript" src="resources/js/common.js"></script>
</html>